package com.shenzhen.group.common.card;

import com.shenzhen.group.common.comparator.CardColorComparator;
import com.shenzhen.group.common.enumeration.CardColorEnum;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 牌类
 * @author 周赛波
 */
@Data
@AllArgsConstructor
public class Card implements Comparable<Card> {

    private CardColorEnum cardColor;
    private Integer value;
    private String showContent;

    public String display() {
        return this.showContent;
    }


    @Override
    public int compareTo(Card o) {
        int res = this.value.compareTo(o.value);
        if (res == 0) {
            return this.cardColor.compareTo(o.cardColor);
        }
        return res;
    }

}
